<!--添加考试课程-->
<template>
  <div class="wrapper-container">
    <div class="search-container">
      <InputItem
        :name="'课程负责单位'"
        :value="unit"
        @input="
          (e) => {
            unit = e;
          }
        "
      ></InputItem>
      <SelectItem
        :name="'培养层次'"
        :value="pycc"
        @change="
          (e) => {
            pycc = e;
          }
        "
        :xqList="pyccList"
      ></SelectItem>
      <SelectItem
        :name="'修习类型'"
        :value="type"
        @change="
          (e) => {
            type = e;
          }
        "
        :xqList="typeList"
      ></SelectItem>
      <InputItem
        :name="'课程编号'"
        :value="courseNum"
        @input="
          (e) => {
            courseNum = e;
          }
        "
      ></InputItem>
      <InputItem
        :name="'课程名称'"
        :value="courseName"
        @input="
          (e) => {
            courseName = e;
          }
        "
      ></InputItem>
      <div class="search-button" style="margin-right: 25px;">
        <img src="../../../assets/assessment/icon-search.png" alt="" />
        <span>查询</span>
      </div>
    </div>
    <div class="table-container">
      <el-table
        :data="tableData1"
        border
        style="width: 40%"
        class="table-data"
        row-class-name="row-class"
        cell-class-name="cell-class"
        header-row-class-name="header-row-class"
        header-cell-class-name="header-cell-class"
        @selection-change="handleSelectionChange"
      >
        >
        <el-table-column type="selection" width="55"> </el-table-column>
        <el-table-column prop="system" label="系" align="center">
        </el-table-column>
        <el-table-column prop="researchOffice" label="教研室" align="center">
        </el-table-column>
        <el-table-column
          prop="cultivationLevel"
          label="培养层次"
          align="center"
        >
        </el-table-column>
        <el-table-column prop="practicetype" label="修习类型" align="center">
        </el-table-column>
        <el-table-column prop="courseNumber" label="课程编号" align="center">
        </el-table-column>
        <el-table-column prop="courseName" label="课程名称" align="center">
        </el-table-column>
      </el-table>

      <el-button
        @click="sureTran"
        style="height: 50px;width:50px;margin:0 20px;background-color:#004ca7"
        type="primary"
        circle
      >
        <i
          style="font-size: 30px;font-weight: bolder;"
          class="el-icon-arrow-right"
        ></i>
      </el-button>
      <el-table
        :data="tableData"
        border
        style="width: 40%"
        class="table-data"
        row-class-name="row-class"
        cell-class-name="cell-class"
        header-row-class-name="header-row-class"
        header-cell-class-name="header-cell-class"
      >
        <el-table-column prop="system" label="系" align="center">
        </el-table-column>
        <el-table-column prop="researchOffice" label="教研室" align="center">
        </el-table-column>
        <el-table-column
          prop="cultivationLevel"
          label="培养层次"
          align="center"
        >
        </el-table-column>
        <el-table-column prop="practicetype" label="修习类型" align="center">
        </el-table-column>
        <el-table-column prop="courseNumber" label="课程编号" align="center">
        </el-table-column>
        <el-table-column prop="courseName" label="课程名称" align="center">
        </el-table-column>
        <el-table-column prop="delete" label="删除" align="center">
          <ButtonItem
            @click=""
            :name="'删除'"
            :link="''"
            :icon="'el-icon-delete'"
            :buttonColor="'red'"
          ></ButtonItem>
        </el-table-column>
      </el-table>
    </div>

    <div class="bottom-block">
      <div class="text">授课教员名字后加“*”为课程负责人</div>
    </div>
  </div>
</template>

<script>
import SelectItem from "../../../components/SelectItem.vue";
import InputItem from "../../../components/InputItem.vue";
import ButtonItem from "../../../components/ButtonItem.vue";
export default {
  components: {
    SelectItem,
    InputItem,
    ButtonItem,
  },
  data() {
    return {
      unit: "",
      type: "专业班次2",
      typeList: [
        {
          value: "专业班次2",
          label: "专业班次2",
        },
        {
          value: "专业班次1",
          label: "专业班次1",
        },
      ],
      pycc: "大专",
      pyccList: [
        {
          value: "大专",
          label: "大专",
        },
        {
          value: "本科",
          label: "本科",
        },
      ],
      courseName: "",
      courseNum: "",
      tableData1: [
        {
          id: "1",
          system: "期中",
          researchOffice: "室一",
          cultivationLevel: "培养层次一",
          practicetype: "选修",
          courseNumber: "212534567",
          courseName: "培养层次一",
        },
        {
          id: "2",
          system: "期中",
          researchOffice: "室二",
          cultivationLevel: "培养层次一",
          practicetype: "选修",
          courseNumber: "212534567",
          courseName: "培养层次一",
        },
      ],
      tableData: [
        {
          id: "3",
          system: "期中",
          researchOffice: "室三",
          cultivationLevel: "培养层次一",
          practicetype: "选修",
          courseNumber: "212534567",
          courseName: "培养层次一",
        },
      ],
      multipleSelection: [],
    };
  },
  methods: {
    handleSelectionChange(val) {
      this.multipleSelection = val;
    },
    sureTran() {
      var temp = this.multipleSelection.map((item, index) => {
        return item.id;
      });
      this.tableData1 = this.tableData1.filter((e) => !temp.includes(e.id));
      this.tableData = [...this.tableData, ...this.multipleSelection];
    },
  },
};
</script>
<style lang="less" scoped>
.search-container {
  justify-content: flex-start !important;
}

.search-button {
  cursor: pointer;
  box-sizing: border-box;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  width: 70px;
  height: 27px;
  background: #f1f8fe;
  border: 1px solid #51aef6;
  border-radius: 6px;

  > span {
    font-size: 14px;
    font-family: Microsoft YaHei;
    font-weight: 400;
    color: #51aef6;
  }

  > img {
    width: 19px;
    height: 19px;
    margin-right: 4px;
  }
}

.table-container {
  margin-top: 30px;

  .el-table td,
  .el-table th.is-leaf,
  .el-table--border,
  .el-table--group {
    border-color: #c7d7eb;
  }

  .el-table__header tr,
  .el-table__header th {
    padding: 0;
    height: 76px;
    background-color: #edf2f9;
    font-size: 16px;
    font-family: Microsoft YaHei;
    font-weight: bold;
    line-height: 20px;
    color: #004ca7;
  }

  .el-table__body tr,
  .el-table__body td {
    padding: 0;
    height: 86px;
  }

  .wrapper-button {
    display: flex;
    flex-direction: column;
    align-items: center;

    > div {
      margin-bottom: 8px;
    }
  }
}
</style>

<style lang="less" scoped>
@import "../../../styles/special.less";

.bottom-block {
  display: flex;
  flex-direction: row;
  justify-content: flex-end;
  .text {
    font-size: 14px;
    font-family: Microsoft YaHei;
    font-weight: 400;
    line-height: 39px;
    color: #004ca7;
  }
}
.wrapper-container {
  width: 1711px;
  margin: 0 auto;
}
.table-container {
  margin-top: 30px;
  display: flex;
  justify-content: space-between;
  align-items: center;

  .table-data {
    min-height: 500px;
    width: 100%;
    border: 0.8px solid #004ca7;
    border-radius: 9px;
    font-size: 14px;
    font-family: Microsoft YaHei;
    font-weight: 400;
    color: #004ca7;
  }
}

.save-button {
  width: 87px;
  height: 36px;
  line-height: 36px;
  background: #fff6ef;
  border: 1px solid #f3b815;
  border-radius: 6px;
  font-size: 18px;
  font-family: Microsoft YaHei;
  font-weight: 400;
  color: #f3b815;
  text-align: center;
  margin: 82px auto;
}

.zuoyou {
  width: 200px;
  display: flex;
  flex-direction: row;
  justify-content: space-between;
}
</style>
